package com.jp.knowledge.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.jp.knowledge.R;
import com.jp.knowledge.model.HeadLineData;

import java.text.DateFormat;
import java.util.List;

/**
 * Created by 528787067@qq.com on 2017/6/26.
 */

public class SecondLevelCommAdapter extends CommtemAdapter {

	private DateFormat dateFormat;

	public SecondLevelCommAdapter(Context context, List infos){
		this(context, infos, null);
	}

	public SecondLevelCommAdapter(Context context, List infos, DateFormat dateFormat) {
		super(context, infos);
		this.dateFormat = dateFormat;
	}

	@Override
	protected void renderData(JPRecycleViewHolder holder, Object item, int position) {
		super.renderData(holder, item, position);
		holder.getView(R.id.icon_close).setVisibility(View.GONE);
		holder.getView(R.id.type).setVisibility(View.GONE);
		holder.getView(R.id.navType).setVisibility(View.GONE);
		if(dateFormat != null)
			setTextView((TextView) holder.getView(R.id.time),
					dateFormat.format(((HeadLineData) item).getCreatetime()));
	}
}
